//express_demo.js 文件
const express = require('express');
const app = express();
const path = require('path')
const swagger=require('./config/swagger')
app.use('/', express.static(path.join(__dirname, '../static')))

app.use(express.json())
//获取所有路由
const routersInit=require('./router/index')
//初始化路由
routersInit(app)

// app.get('/', function (req, res) {
//     res.send('Hello World');
// })
const PORT=8081
swagger(app,PORT)
const server = app.listen(PORT, function () {

    const host = server.address().address
    const port = server.address().port

    console.log("应用实例，访问地址为 http://%s:%s", host, port)

})